﻿using Inovout.Cloud.Identity.Web.Models;
using Inovout.Cloud.Web.Http;
using Inovout.Memberships;
using System.Threading;
using System.Web.Http;

namespace Inovout.Cloud.Identity.Web.Controllers
{
    public class MeController : CloudHttpController
    {
        [Route("v1/me")]
        public MembershipUserInfo Get()
        {
            //var  membershipUser = ComponentRegistry.Resolve<IMembershipUserService>().FindByClaimedIdentifier(Thread.CurrentPrincipal.Identity.Name);

            return new MembershipUserInfo { UserIdentifier = this.User.Identity.Name,
                Name = MembershipUser.Membership.Name,Email= MembershipUser.Email };

        }
    }
}
